package Test11.topic;
/*本类用于练习面向对象----封装*/
public class Pricate {
    public static void main(String[] args) {

        new Phine(11).sleep(55);
        Phine p = new Phine();
        p.setName("天");
        System.out.println(p.getName());
        Phine p1 = new Phine(45678);
    }
}
class Phine{
    public Phine(){
        System.out.println("我是构造方法");
    }
    public Phine(int a){
        System.out.println("我是一个无情的构造方法"+a);
    }
    private String name;
    private int age;
    private double price;
    private String kind;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public void sleep(int a){
        System.out.println("手机已经休眠了"+a+"个小时");
    }
    public void rum(String b){
        System.out.println("手机已经"+b+"工作了一天");
    }
    public String bark(){
        System.out.println("手机发出噪音");
        return  "分贝";
    }
}